<?php


class modelo_form_select {
    
    protected $r = "";
    protected $nome_campo = "";


    public function __construct($nome_campo) {
        //$this->nome_campo = $nome_campo;
        $this->r = '<select name="' . $nome_campo . '">';
    }
    
    public function addItem($value, $text, $selected = false) {
        $this->r.= '<option value="'.$value.'"';
        
        if($selected) {
            $this->r.= ' selected="selected"';
        }
        
        $this->r.= '>'.$text.'</option>';
    }
    
    public function render() {
        $this->r.= '</select>';
        echo $this->r;
    }
    
}


?>
